<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<script language="JavaScript">
<!--
function killerrors() { 
return true; 
}
window.onerror = killerrors;
//-->
</script>
<style type="text/css" >
#bimg img { 
vertical-align: middle;
max-width:600px;   /* FF IE7 */
width:expression(this.width > 600 && this.width > this.height ? 600 : true);
overflow:hidden;
}
</style>
<!--begin main-->
<div id="main">
  <!--begin left-->
  <div id="main_l" class="bdr_1">
    <!--位置导航-->
<div id="position"><a href="">首页</a><?php echo catpos($catid);?></div>
    <div id="content">
    <div id="content_head">
      <!--文章标题-->
      <h1><?php echo $title;?></h1>
      <!--基本属性-->
      <h2><span><?php echo $updatetime;?></span> 作者：<?php if($author) { ?><?php echo $author;?><?php } else { ?><?php echo $userid;?><?php } ?> 来源：<?php echo $copyfrom;?> 浏览次数：<span id="hits">0</span>
  <?php if(isset($MODULE[comment])) { ?><?php list($keyid, $verify) = keyid_make('phpcms', 'content', 'title', $contentid);?>
<a href="<?php echo $MODULE['comment']['url'];?>?keyid=<?php echo $keyid;?>&verify=<?php echo $verify;?>" style="color:red;">网友评论 <span id="comments_top">0</span> 条</a>
<?php } ?></h2></div>
      <!--begin 图片浏览-->

<div id="ArticleCnt">
  <a id="p" name="p"></a>
  <div id="lantern">
  <!--播放工具-->
    <div id="tool">
      <div class="f_l">
        <select id="cSpeed" onchange="SaveTime()" style="display: none;">
          <option value="6" selected="selected">中</option>
        </select>
        <input style="display: inline;" id="startplay" title="播放/暂停" src="images/picture/9423081.gif" onclick="playpic()" align="absmiddle" type="image">
        <input id="stopplay" title="播放/暂停" src="images/picture/9423085.gif" style="display: none;" onclick="stop()" align="absmiddle" type="image">
<?php if($page==1) { ?><img src="images/picture/9423087.gif" align="absmiddle" width="48" height="22">
<?php } else { ?><a href="javascript:changeUrl(<?php echo max(intval($page-1),1);?>)"><img src="images/picture/9423087.gif" alt="上一张" align="absmiddle" width="48" height="22"></a><?php } ?>
<?php if($page==$images_number) { ?>&nbsp;
<img src="images/picture/9423077.gif" align="absmiddle" width="48" height="22">
<?php } else { ?>
<a href="javascript:changeUrl(<?php echo min(intval($page+1),$images_number);?>)"><img src="images/picture/9423077.gif" alt="下一张" align="absmiddle" width="48" height="22"></a>
<?php } ?>
        <select id="pagejump" onchange="changeUrl(this.value)">
<?php if(is_array($array_images)) foreach($array_images AS $j => $img) { ?>
          <option value="<?php echo $j;?>" <?php if($j==$page) { ?>selected<?php } ?>><?php echo $j;?>/<?php echo $images_number;?>张</option>
<?php } ?>
        </select>
      </div>
      <div class="f_r"> <a href="<?php echo $array_images[$page]['filepath'];?>" target="_blank"><img src="images/picture/9423079.gif" border="0" width="60" height="22"></a> </div>
      <div class="clear"></div>
    </div>
    <!--正中大图-->
    <div id="bimg"><a href="javascript:changeUrl(<?php echo min($page+1,$images_number);?>)"><img style="cursor: pointer;" src="<?php echo $array_images[$page]['filepath'];?>" alt="点击浏览下一张" ></a>
<?php if($array_images[$page][description]) { ?><div id="Explain"><?php echo $array_images[$page]['description'];?></div><?php } ?>
    </div>

    <div id="simg">
      <div class="p">
      <?php if(($page > 6)) { ?>
      <a href="javascript:changeUrl(<?php echo intval(floor($page/6)*6-5);?>)"><img src="images/picture/9423218.gif" alt="上一组"></a>
      <?php } else { ?>
      <img src="images/picture/9423218.gif">
      <?php } ?>
    </div>
      <div id="sImage">
<?php if(is_array($array_images)) foreach($array_images AS $k => $r) { ?>
<?php if(($k<ceil($page/6)*6-5) || ($k>ceil($page/6)*6)) continue;?>
 <div><a href="javascript:changeUrl(<?php echo $k;?>)"><img src="<?php echo thumb($r[filepath], 60, 60);?>" alt="点击浏览大图" width="60" height="60" <?php if($k==$page) { ?>class="s"<?php } ?>/></a></div>
<?php } ?>
      </div>
      <div class="n"><a href="javascript:changeUrl(<?php echo min(ceil($page/6)*6+1,$images_number);?>)"><img src="images/picture/9423216.gif" alt="下一组"></a></div>
    </div>
  </div>
  <div id="hdcnt"></div>
</div>

      <!--end 图片浏览-->
     <!--图片介绍-->
      <div id="digest"><strong>图片介绍：</strong><?php echo $description;?></div>
      
<!--心情指数模块-->
      <?php if(isset($MODULE[mood])) { ?>
      <div id="moodrank_div"></div>
      <script  type="text/javascript">var contentid = <?php echo $contentid;?>;</script>
      <script type="text/javascript" id="callback_js"></script>
      <script type="text/javascript" src="data/moodrank/1.js"></script>
      <?php } ?>
      <?php if(isset($MODULE[digg])) { ?>
      <div id="digg_div"></div>
  <script  type="text/javascript">var contentid = <?php echo $contentid;?>; var catid = <?php echo $catid;?></script>
  <script type="text/javascript" id="calldigg_js"></script>
      <script type="text/javascript" src="<?php echo $MODULE['digg']['url'];?>digg.php?contentid=<?php echo $contentid;?>&catid=<?php echo $catid;?>"></script>
      <?php } ?>
      <!--快速链接-->
<div class="clear"></div>
      <?php if(isset($MODULE[mail])) { ?>
      <form action="<?php echo $MODULE['mail']['url'];?>sendmail.php" name="sendmail" id="sendmail">
        <input type="hidden" name="title" value="推荐：<?php echo $title;?>" />
        <input type="hidden" name="content" value=" <a href='<?php echo SITE_URL;?><?php echo $url;?>' target='_blank'><?php echo $title;?></a><br/>" />
      </form>
      <?php } ?>
      <?php if(isset($MODULE[error_report])) { ?>
      <form action="<?php echo $MODULE['error_report']['url'];?>error_report.php" name="errors" id="errors">
        <input type="hidden" name="title" value="<?php echo $title;?>" />
<input type="hidden" name="contentid" value="<?php echo $contentid;?>" />
      </form>
      <?php } ?>      
      <h3 class="align_r"><?php if(isset($MODULE[error_report])) { ?><a href="javascript:$('#errors').submit();">[错误报告]</a><?php } ?> <?php if(isset($MODULE[mail])) { ?><a href="javascript:$('#sendmail').submit();">[推荐]</a><?php } ?> <a href="javascript:myAddPanel('<?php echo $title;?>',window.location.href)">[收藏]</a> <a href="javascript:window.print();">[打印]</a> <a href="javascript:window.close();">[关闭]</a> <a href="<?php echo SITE_URL;?><?php echo $url;?>#top">[返回顶部]</a> </h3>
      <!--评论-->
      <?php if(isset($MODULE[comment])) { ?>
      <?php list($keyid, $verify) = keyid_make('phpcms', 'content', 'title', $contentid);?>
      <div id="commnent_tag"><a href="<?php echo $MODULE['comment']['url'];?>?keyid=<?php echo $keyid;?>&verify=<?php echo $verify;?>"><img src="images/comment.gif" alt=""/></a> 当前共有<strong class="c_red"><span id="comments">0</span></strong>人发表了评论.
      </div>
      <div class="commenttext" style="text-align:center;margin-top:2%">
        <form action="<?php echo $MODULE['comment']['url'];?>?action=addpost" method="post" onSubmit="return checkForm();">
<input type="hidden" name="keyid" value="<?php echo $keyid;?>"/>
<input type="hidden" name="verify" value="<?php echo $verify;?>"/>
<ul>
          <li>
            <textarea cols="100" rows="8" name="comment" id="comment" onfocus="reply_clearfield()" onblur="reply_restoration()"></textarea>
          </li>
          <li style="text-align:left;margin-left:1%;margin-top:1%;">
            <span id="checker"><div style="float:left">验证码：</div><input type="text" style="ime-mode: disabled;" size="6" id="checkcode" name="checkcode" /><img src="" id="code_img" style="display:none" onclick="this.src='checkcode.php?'+Math.random()" alt="点击换一张"></span>
            <input id="dosubmit" name="dosubmit" type="submit" value="发表评论" />
          </li>
        </ul>
        </form>
      </div>
       <script type="text/javascript" src="data/js/comment_setting.js"></script>
      <script>
        $().ready(function() {
            if(setting.ischecklogin == 0 && getcookie('auth') === null)
            {
                $('#comment').val("请您登陆后发表评论！");
                $('#comment').attr("disabled","disabled");
                $('#dosubmit').attr("disabled","disabled");
            }
            else 
            {
                $('#comment').val("我也来说两句！");
            }
        });
        function reply_restoration()
        {
            if($('#comment').val() == '')
            {
                $('#comment').val("我也来说两句！");
            }
        }
        function reply_clearfield()
        {
            if ($('#comment').val() == "我也来说两句！") 
            {
                $('#comment').val("");   
            }
document.getElementById('code_img').style.display = 'block';document.getElementById('code_img').src='checkcode.php';
        }
        function checkForm()
        {
            if($('#comment').val() == '' || $('#comment').val() == "我也来说两句！")
            {
                alert("内容不能为空");
                $('#comment').focus();
                return false;
            }
            if($('#checkcode').val() == '' )
            {
                alert("验证码不能为空");
                $('#checkcode').focus();
                return false;
            }
            if ($('#comment').val().length > 1000) 
            {
                alert("内容太长，最多 1000 个文字");
                return false;
            }
        }
    </script>
      <?php } ?> </div>
    <div class="clear" style="margin-top:1%"></div>    
    </div>
  <!--end left-->
  <!--begin right-->
  <div id="main_r" >
     <h4><a href="<?php echo $MODULE['special']['url'];?>"><img src="images/more.gif" alt="更多" /></a>专题精选</h4>
    <div class="pic_txt_list">
      <!--在ul外单加一个DIV为了防止一些意想不到的问题-->
      <ul>
        <?php echo tag('special', 'tag_special', "SELECT * FROM `phpcms_special`  ORDER BY listorder DESC,specialid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'width' => '90',  'height' => '62',));?>
      </ul>
    </div>
    <h4>推荐图片新闻</h4>
    <div>
      <ul class="pic_list">
        <?php echo tag('phpcms', 'tag_content_pic', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url FROM `phpcms_content` WHERE  status=99   AND  `thumb`!='' ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 4, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '14',  'height' => '60',  'width' => '87',));?>
      </ul>
    </div>
    <h4><a href="<?php echo $MODULE['digg']['url'];?>"><img src="images/more.gif" alt="更多" /></a>DIGG 周排行</h4>
    <div>
<ul class="digg_text_list">
<?php $DATA = get("select d.contentid,d.supports,c.title,c.style,c.url from phpcms_digg d left join phpcms_content c on d.contentid=c.contentid where c.status=99 AND c.catid='$catid' order by d.supports_week desc", 10, 0, "", "");foreach($DATA AS $n => $r) { $n++;?>
<li><span><?php echo $r['supports'];?></span><a href="<?php echo $r['url'];?>" target="_blank" class="<?php echo $r['style'];?>"><?php echo str_cut($r[title], 44);?></a></li>
<?php } unset($DATA); ?>
      </ul>
    </div>
<?php echo block("list_picture", 1);?>
  </div>
  <!--end right-->
</div>
<!--end main-->
<script language="JavaScript">
<!--
function changeUrl(id)
{
<?php if($ishtml==1) { ?>
var url = '<?php echo $show_url_path;?>';
redirect(url+'_'+id+'.<?php echo $PHPCMS['fileext'];?>');
<?php } else { ?>
redirect("<?php echo SCRIPT_NAME;?>?contentid=<?php echo $contentid;?>&page="+id);
<?php } ?>
}
var autoplay=false;
if(getcookie("autoplay") != null)
{
  if(getcookie("autoplay")=="1")
  {
   autoplay=true;
   $('#startplay').css('display','none');
   $('#stopplay').css('display','inline');
  }
  else
  {
$('#startplay').css('display','inline');
$('#stopplay').css('display','none');
  }
}
else
{
stop();
}
if(autoplay)
{
setInterval("play()",6000);
}
function playpic()
{ 

   $('#startplay').css('display','none');
   $('#stopplay').css('display','inline');
   setcookie("autoplay",1);
   play();
}
function play()
{
var t = <?php echo $images_number;?>;
var page = <?php echo $page;?>;
if(t==page)
{
stop();
}
else
{
setInterval("changeUrl(<?php echo min(intval($page+1),$images_number);?>)",6000);
}
}
function stop()
{
setcookie("autoplay",0);
$('#startplay').css('display','inline');
$('#stopplay').css('display','none');
}
//-->
</script>
<script language="JavaScript" src="count.php?contentid=<?php echo $contentid;?>"></script>
<?php include template('phpcms','footer'); ?>